import request from '@/util/request'

export const roleAdd = (data: any) => {
  return request({
    url: '/role',
    method: 'POST',
    data: data
  })
}
export const roleRemove = (id: number) => {
  return request({
    url: '/role',
    method: 'DELETE',
    params: {
      id: id
    }
  })
}
export const roleModify = (data: any) => {
  return request({
    url: '/role',
    method: 'PUT',
    data: data
  })
}
export const roleFind = (pageInfo: any) => {
  return request({
    url: '/role/list',
    method: 'GET',
    params: pageInfo
  })
}
export const roleFindById = (id: number) => {
  return request({
    url: '/role',
    method: 'GET',
    params: {
      id: id
    }
  })
}

export const modifyRoleRouter = (data: any) => {
  return request({
    url: '/role/router',
    method: 'PUT',
    data: data
  })
}
export const modifyRolePermission = (data: any) => {
  return request({
    url: '/role/permission',
    method: 'PUT',
    data: data
  })
}
